package com.atung.dao;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import com.atung.model.AdmSchool;
import com.atung.provider.AdmSchoolProvider;
import com.atung.response.ResponsePagePath;

@Mapper
public interface SchoolPageDAO {

	/**
	 * 获取开通城市路线
	 * @param departure
	 * @param city
	 * @return
	 */
	@Select("select * from bus_car_route where place_departure=#{departure}  and destination_city=#{city}"
			+ "and  is_delect=0 and city_type=0 ")
	List<ResponsePagePath>selectSchoolNameAndCity(
			@Param("departure")String departure,
			@Param("city")String city);
	/**
	 * 根据城市id 获取城市开通列表
	 */
	@Select("select * from bus_car_route where is_delect=0 and city_id=#{cityId}")
	List<ResponsePagePath>selectCityId(@Param("cityId")Long cityId);
	
	/**
	 * 随机返回开启路线城市
	 */
	@Select("select * from bus_car_route where is_delect=0 and running_status=0 and city_type=0")
	List<ResponsePagePath>selectRandom();
	

}
